
#include "threadpool.h"
#include <iostream>
#include <unistd.h>
using namespace std;

class MyTask : public Task
{
public:
    void run()
    {
        cout << pthread_self() << endl;
        cout << "我是一个大任务a!" << endl;
        usleep(10000);
    }
};

int main()
{
    ThreadPool pool;
    pool.startPool(1);

    pool.submit(shared_ptr<Task>(new MyTask));
    pool.submit(shared_ptr<Task>(new MyTask));
    pool.submit(shared_ptr<Task>(new MyTask));
    pool.submit(shared_ptr<Task>(new MyTask));
    sleep(100);
}